﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.CUiMovMovieManagerEnabler
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.Collections.ObjectModel;
using Tecnomatix.Engineering;
using Tecnomatix.Engineering.PrivateImplementationDetails;


namespace DnProcessSimulateCommands;

public class CUiMovMovieManagerEnabler : ITxCommandEnabler
{
  public bool IsReadyToEnable()
  {
    bool enable = false;
    switch (TxApplication.ActiveSelection.TotalCount)
    {
      case 0:
        enable = true;
        break;
      case 1:
        TxObjectList items = TxApplication.ActiveSelection.GetItems();
        if (((Collection<ITxObject>) items).Count == 1)
        {
          ITxObject itxObject = ((Collection<ITxObject>) items)[0];
          switch (itxObject)
          {
            case ITxTcOperation _:
            case TxTcActivity _:
            case TxTcProcess _:
              if (TxTcUtilities.IsTcAnyPlatform)
                break;
              goto default;
            default:
              if (TxApplication.PlatformType != 1 || (!(itxObject is ITxCompoundOperation) || itxObject is ITxLocationOperation) && !(itxObject is TxOperationRoot))
                goto label_7;
              break;
          }
          enable = true;
          break;
        }
        break;
    }
label_7:
    return enable;
  }

  public bool Enable => this.IsReadyToEnable();
}
